<?php

// PHPMaker 5 configuration for Table view_reg_master_netsales
$view_reg_master_netsales = new cview_reg_master_netsales; // Initialize table object

// Define table class
class cview_reg_master_netsales {

	// Define table level constants
	var $TableVar;
	var $TableName;
	var $SelectLimit = FALSE;
	var $ID;
	var $LogDate;
	var $RegID;
	var $UserName;
	var $StoreNet;
	var $ShortOver;
	var $DiffIPP;
	var $LogIPP;
	var $QtyIPP;
	var $BankIPP;
	var $XReadMOAmtDiff;
	var $MOAmt;
	var $BankMO;
	var $CreditAmt;
	var $BankCC;
	var $DiffCopay;
	var $CashRxDiffAmt;
	var $CheckAmt;
	var $LunchAmt;
	var $PayoutAmt;
	var $z340B;
	var $Kinray;
	var $CashAdj;
	var $OverAmt;
	var $fields = array();

	function cview_reg_master_netsales() {
		$this->TableVar = "view_reg_master_netsales";
		$this->TableName = "view_reg_master_netsales";
		$this->SelectLimit = TRUE;
		$this->ID = new cField('view_reg_master_netsales', 'x_ID', 'ID', "`ID`", 3, -1, FALSE);
		$this->fields['ID'] =& $this->ID;
		$this->LogDate = new cField('view_reg_master_netsales', 'x_LogDate', 'LogDate', "`LogDate`", 135, 5, FALSE);
		$this->fields['LogDate'] =& $this->LogDate;
		$this->RegID = new cField('view_reg_master_netsales', 'x_RegID', 'RegID', "`RegID`", 200, -1, FALSE);
		$this->fields['RegID'] =& $this->RegID;
		$this->UserName = new cField('view_reg_master_netsales', 'x_UserName', 'UserName', "`UserName`", 200, -1, FALSE);
		$this->fields['UserName'] =& $this->UserName;
		$this->StoreNet = new cField('view_reg_master_netsales', 'x_StoreNet', 'StoreNet', "`StoreNet`", 5, -1, FALSE);
		$this->fields['StoreNet'] =& $this->StoreNet;
		$this->ShortOver = new cField('view_reg_master_netsales', 'x_ShortOver', 'ShortOver', "`ShortOver`", 5, -1, FALSE);
		$this->fields['ShortOver'] =& $this->ShortOver;
		$this->DiffIPP = new cField('view_reg_master_netsales', 'x_DiffIPP', 'DiffIPP', "`DiffIPP`", 5, -1, FALSE);
		$this->fields['DiffIPP'] =& $this->DiffIPP;
		$this->LogIPP = new cField('view_reg_master_netsales', 'x_LogIPP', 'LogIPP', "`LogIPP`", 5, -1, FALSE);
		$this->fields['LogIPP'] =& $this->LogIPP;
		$this->QtyIPP = new cField('view_reg_master_netsales', 'x_QtyIPP', 'QtyIPP', "`QtyIPP`", 5, -1, FALSE);
		$this->fields['QtyIPP'] =& $this->QtyIPP;
		$this->BankIPP = new cField('view_reg_master_netsales', 'x_BankIPP', 'BankIPP', "`BankIPP`", 5, -1, FALSE);
		$this->fields['BankIPP'] =& $this->BankIPP;
		$this->XReadMOAmtDiff = new cField('view_reg_master_netsales', 'x_XReadMOAmtDiff', 'XReadMOAmtDiff', "`XReadMOAmtDiff`", 5, -1, FALSE);
		$this->fields['XReadMOAmtDiff'] =& $this->XReadMOAmtDiff;
		$this->MOAmt = new cField('view_reg_master_netsales', 'x_MOAmt', 'MOAmt', "`MOAmt`", 5, -1, FALSE);
		$this->fields['MOAmt'] =& $this->MOAmt;
		$this->BankMO = new cField('view_reg_master_netsales', 'x_BankMO', 'BankMO', "`BankMO`", 5, -1, FALSE);
		$this->fields['BankMO'] =& $this->BankMO;
		$this->CreditAmt = new cField('view_reg_master_netsales', 'x_CreditAmt', 'CreditAmt', "`CreditAmt`", 5, -1, FALSE);
		$this->fields['CreditAmt'] =& $this->CreditAmt;
		$this->BankCC = new cField('view_reg_master_netsales', 'x_BankCC', 'BankCC', "`BankCC`", 5, -1, FALSE);
		$this->fields['BankCC'] =& $this->BankCC;
		$this->DiffCopay = new cField('view_reg_master_netsales', 'x_DiffCopay', 'DiffCopay', "`DiffCopay`", 5, -1, FALSE);
		$this->fields['DiffCopay'] =& $this->DiffCopay;
		$this->CashRxDiffAmt = new cField('view_reg_master_netsales', 'x_CashRxDiffAmt', 'CashRxDiffAmt', "`CashRxDiffAmt`", 5, -1, FALSE);
		$this->fields['CashRxDiffAmt'] =& $this->CashRxDiffAmt;
		$this->CheckAmt = new cField('view_reg_master_netsales', 'x_CheckAmt', 'CheckAmt', "`CheckAmt`", 5, -1, FALSE);
		$this->fields['CheckAmt'] =& $this->CheckAmt;
		$this->LunchAmt = new cField('view_reg_master_netsales', 'x_LunchAmt', 'LunchAmt', "`LunchAmt`", 5, -1, FALSE);
		$this->fields['LunchAmt'] =& $this->LunchAmt;
		$this->PayoutAmt = new cField('view_reg_master_netsales', 'x_PayoutAmt', 'PayoutAmt', "`PayoutAmt`", 5, -1, FALSE);
		$this->fields['PayoutAmt'] =& $this->PayoutAmt;
		$this->z340B = new cField('view_reg_master_netsales', 'x_z340B', '340B', "`340B`", 5, -1, FALSE);
		$this->fields['340B'] =& $this->z340B;
		$this->Kinray = new cField('view_reg_master_netsales', 'x_Kinray', 'Kinray', "`Kinray`", 5, -1, FALSE);
		$this->fields['Kinray'] =& $this->Kinray;
		$this->CashAdj = new cField('view_reg_master_netsales', 'x_CashAdj', 'CashAdj', "`CashAdj`", 5, -1, FALSE);
		$this->fields['CashAdj'] =& $this->CashAdj;
		$this->OverAmt = new cField('view_reg_master_netsales', 'x_OverAmt', 'OverAmt', "`OverAmt`", 5, -1, FALSE);
		$this->fields['OverAmt'] =& $this->OverAmt;
	}

	// Records per page
	function getRecordsPerPage() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_REC_PER_PAGE];
	}

	function setRecordsPerPage($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_REC_PER_PAGE] = $v;
	}

	// Start record number
	function getStartRecordNumber() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_START_REC];
	}

	function setStartRecordNumber($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_START_REC] = $v;
	}

	// Advanced search
	function getAdvancedSearch($fld) {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld];
	}

	function setAdvancedSearch($fld, $v) {
		if (@$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld] <> $v) {
			$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld] = $v;
		}
	}

	// Basic search Keyword
	function getBasicSearchKeyword() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH];
	}

	function setBasicSearchKeyword($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH] = $v;
	}

	// Basic Search Type
	function getBasicSearchType() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH_TYPE];
	}

	function setBasicSearchType($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH_TYPE] = $v;
	}

	// Search where clause
	function getSearchWhere() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_SEARCH_WHERE];
	}

	function setSearchWhere($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_SEARCH_WHERE] = $v;
	}

	// Single column sort
	function UpdateSort(&$ofld) {
		if ($this->CurrentOrder == $ofld->FldName) {
			$sSortField = $ofld->FldExpression;
			$sLastSort = $ofld->getSort();
			if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") {
				$sThisSort = $this->CurrentOrderType;
			} else {
				$sThisSort = ($sLastSort == "ASC") ? "DESC" : "ASC";
			}
			$ofld->setSort($sThisSort);
			$this->setSessionOrderBy($sSortField . " " . $sThisSort); // Save to Session
		} else {
			$ofld->setSort("");
		}
	}

	// Session WHERE Clause
	function getSessionWhere() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_WHERE];
	}

	function setSessionWhere($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_WHERE] = $v;
	}

	// Session ORDER BY
	function getSessionOrderBy() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ORDER_BY];
	}

	function setSessionOrderBy($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ORDER_BY] = $v;
	}

	// Session Key
	function getKey($fld) {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_KEY . "_" . $fld];
	}

	function setKey($fld, $v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_KEY . "_" . $fld] = $v;
	}

	// Table level SQL
	function SqlSelect() { // Select
		return "SELECT * FROM `view_reg_master_netsales`";
	}

	function SqlWhere() { // Where
		return "";
	}

	function SqlGroupBy() { // Group By
		return "";
	}

	function SqlHaving() { // Having
		return "";
	}

	function SqlOrderBy() { // Order By
		return "LogDate DESC";
	}

	// SQL variables
	var $CurrentFilter; // Current filter
	var $CurrentOrder; // Current order
	var $CurrentOrderType; // Current order type

	// Report table sql
	function SQL() {
		$sFilter = $this->CurrentFilter;
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$sFilter, $sSort);
	}

	// Return table sql with list page filter
	function SelectSQL() {
		$sFilter = $this->getSessionWhere();
		if ($this->CurrentFilter <> "") {
			if ($sFilter <> "") $sFilter .= " AND ";
			$sFilter .= $this->CurrentFilter;
		}
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$sFilter, $sSort);
	}

	// Return record count
	function SelectRecordCount() {
		global $conn;
		$cnt = -1;
		$sFilter = $this->CurrentFilter;
		$this->Recordset_Selecting($this->CurrentFilter);
		if ($this->SelectLimit) {
			$sSelect = $this->SelectSQL();
			if (strtoupper(substr($sSelect, 0, 13)) == "SELECT * FROM") {
				$sSelect = "SELECT COUNT(*) FROM" . substr($sSelect, 13);
				if ($rs = $conn->Execute($sSelect)) {
					if (!$rs->EOF) $cnt = $rs->fields[0];
					$rs->Close();
				}
			}
		}
		if ($cnt == -1) {
			if ($rs = $conn->Execute($this->SelectSQL())) {
				$cnt = $rs->RecordCount();
				$rs->Close();
			}
		}
		$this->CurrentFilter = $sFilter;
		return intval($cnt);
	}

	// INSERT statement
	function InsertSQL(&$rs) {
		$names = "";
		$values = "";
		foreach ($rs as $name => $value) {
			$names .= $this->fields[$name]->FldExpression . ",";
			$values .= (is_null($value) ? "NULL" : ew_QuotedValue($value, $this->fields[$name]->FldDataType)) . ",";
		}
		if (substr($names, -1) == ",") $names = substr($names, 0, strlen($names)-1);
		if (substr($values, -1) == ",") $values = substr($values, 0, strlen($values)-1);
		return "INSERT INTO `view_reg_master_netsales` ($names) VALUES ($values)";
	}

	// UPDATE statement
	function UpdateSQL(&$rs) {
		$SQL = "UPDATE `view_reg_master_netsales` SET ";
		foreach ($rs as $name => $value) {
			$SQL .= $this->fields[$name]->FldExpression . "=" .
					(is_null($value) ? "NULL" : ew_QuotedValue($value, $this->fields[$name]->FldDataType)) . ",";
		}
		if (substr($SQL, -1) == ",") $SQL = substr($SQL, 0, strlen($SQL)-1);
		if ($this->CurrentFilter <> "")	$SQL .= " WHERE " . $this->CurrentFilter;
		return $SQL;
	}

	// DELETE statement
	function DeleteSQL(&$rs) {
		$SQL = "DELETE FROM `view_reg_master_netsales` WHERE ";
		$SQL .= EW_DB_QUOTE_START . 'ID' . EW_DB_QUOTE_END . '=' .	ew_QuotedValue($rs['ID'], $this->ID->FldDataType) . ' AND ';
		if (substr($SQL, -5) == " AND ") $SQL = substr($SQL, 0, strlen($SQL)-5);
		if ($this->CurrentFilter <> "")	$SQL .= " AND " . $this->CurrentFilter;
		return $SQL;
	}

	// Key filter for table
	function SqlKeyFilter() {
		return "`ID` = @ID@";
	}

	// Return url
	function getReturnUrl() {
		if (@$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL] <> "") {
			return $_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL];
		} else {
			return "view_reg_master_netsaleslist.php";
		}
	}

	function setReturnUrl($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL] = $v;
	}

	// View url
	function ViewUrl() {
		return $this->KeyUrl("view_reg_master_netsalesview.php");
	}

	// Edit url
	function EditUrl() {
		return $this->KeyUrl("view_reg_master_netsalesedit.php");
	}

	// Inline edit url
	function InlineEditUrl() {
		return $this->KeyUrl("view_reg_master_netsaleslist.php", "a=edit");
	}

	// Copy url
	function CopyUrl() {
		return $this->KeyUrl("view_reg_master_netsalesadd.php");
	}

	// Inline copy url
	function InlineCopyUrl() {
		return $this->KeyUrl("view_reg_master_netsaleslist.php", "a=copy");
	}

	// Delete url
	function DeleteUrl() {
		return $this->KeyUrl("view_reg_master_netsalesdelete.php");
	}

	// Key url
	function KeyUrl($url, $action = "") {
		$sUrl = $url . "?";
		if ($action <> "") $sUrl .= $action . "&";
		if (!is_null($this->ID->CurrentValue)) {
			$sUrl .= "ID=" . urlencode($this->ID->CurrentValue);
		} else {
			return "javascript:alert('Invalid Record! Key is null');";
		}
		return $sUrl;
	}

	// Function LoadRs
	// - Load Row based on Key Value
	function LoadRs($sFilter) {
		global $conn;

		// Set up filter (Sql Where Clause) and get Return Sql
		$this->CurrentFilter = $sFilter;
		$sSql = $this->SQL();
		return $conn->Execute($sSql);
	}

	// Load row values from rs
	function LoadListRowValues(&$rs) {
		$this->ID->setDbValue($rs->fields('ID'));
		$this->LogDate->setDbValue($rs->fields('LogDate'));
		$this->RegID->setDbValue($rs->fields('RegID'));
		$this->UserName->setDbValue($rs->fields('UserName'));
		$this->StoreNet->setDbValue($rs->fields('StoreNet'));
		$this->ShortOver->setDbValue($rs->fields('ShortOver'));
		$this->DiffIPP->setDbValue($rs->fields('DiffIPP'));
		$this->LogIPP->setDbValue($rs->fields('LogIPP'));
		$this->QtyIPP->setDbValue($rs->fields('QtyIPP'));
		$this->BankIPP->setDbValue($rs->fields('BankIPP'));
		$this->XReadMOAmtDiff->setDbValue($rs->fields('XReadMOAmtDiff'));
		$this->MOAmt->setDbValue($rs->fields('MOAmt'));
		$this->BankMO->setDbValue($rs->fields('BankMO'));
		$this->CreditAmt->setDbValue($rs->fields('CreditAmt'));
		$this->BankCC->setDbValue($rs->fields('BankCC'));
		$this->DiffCopay->setDbValue($rs->fields('DiffCopay'));
		$this->CashRxDiffAmt->setDbValue($rs->fields('CashRxDiffAmt'));
		$this->CheckAmt->setDbValue($rs->fields('CheckAmt'));
		$this->LunchAmt->setDbValue($rs->fields('LunchAmt'));
		$this->PayoutAmt->setDbValue($rs->fields('PayoutAmt'));
		$this->z340B->setDbValue($rs->fields('340B'));
		$this->Kinray->setDbValue($rs->fields('Kinray'));
		$this->CashAdj->setDbValue($rs->fields('CashAdj'));
		$this->OverAmt->setDbValue($rs->fields('OverAmt'));
	}

	// Render list row values
	function RenderListRow() {
		global $conn, $Security;

		// ID
		$this->ID->ViewValue = $this->ID->CurrentValue;
		$this->ID->CssStyle = "";
		$this->ID->CssClass = "";
		$this->ID->ViewCustomAttributes = "";

		// LogDate
		if (!is_null($this->LogDate->CurrentValue)) {
			$sSqlWrk = "SELECT DISTINCT `LogDate2` FROM `view_log_date` WHERE `LogDate` = '" . ew_AdjustSql($this->LogDate->CurrentValue) . "'";
			$sSqlWrk .= " ORDER BY `LogDate` Desc";
			$rswrk = $conn->Execute($sSqlWrk);
			if ($rswrk) {
				if (!$rswrk->EOF) {
					$this->LogDate->ViewValue = $rswrk->fields('LogDate2');
				}
				$rswrk->Close();
			} else {
				$this->LogDate->ViewValue = $this->LogDate->CurrentValue;
			}
		} else {
			$this->LogDate->ViewValue = NULL;
		}
		$this->LogDate->ViewValue = ew_FormatDateTime($this->LogDate->ViewValue, 5);
		$this->LogDate->CssStyle = "";
		$this->LogDate->CssClass = "";
		$this->LogDate->ViewCustomAttributes = "";

		// RegID
		if (!is_null($this->RegID->CurrentValue)) {
			$sSqlWrk = "SELECT `RegisterID` FROM `tb_register` WHERE `RegisterID` = '" . ew_AdjustSql($this->RegID->CurrentValue) . "'";
			$sSqlWrk .= " ORDER BY `RegisterID` Asc";
			$rswrk = $conn->Execute($sSqlWrk);
			if ($rswrk) {
				if (!$rswrk->EOF) {
					$this->RegID->ViewValue = $rswrk->fields('RegisterID');
				}
				$rswrk->Close();
			} else {
				$this->RegID->ViewValue = $this->RegID->CurrentValue;
			}
		} else {
			$this->RegID->ViewValue = NULL;
		}
		$this->RegID->CssStyle = "";
		$this->RegID->CssClass = "";
		$this->RegID->ViewCustomAttributes = "";

		// UserName
		$this->UserName->ViewValue = $this->UserName->CurrentValue;
		$this->UserName->CssStyle = "";
		$this->UserName->CssClass = "";
		$this->UserName->ViewCustomAttributes = "";

		// StoreNet
		$this->StoreNet->ViewValue = $this->StoreNet->CurrentValue;
		$this->StoreNet->ViewValue = ew_FormatNumber($this->StoreNet->ViewValue, 2, -2, -2, -2);
		$this->StoreNet->CssStyle = "";
		$this->StoreNet->CssClass = "";
		$this->StoreNet->ViewCustomAttributes = "";

		// ShortOver
		$this->ShortOver->ViewValue = $this->ShortOver->CurrentValue;
		$this->ShortOver->ViewValue = ew_FormatNumber($this->ShortOver->ViewValue, 2, -2, -2, -2);
		$this->ShortOver->CssStyle = "";
		$this->ShortOver->CssClass = "";
		$this->ShortOver->ViewCustomAttributes = "";

		// DiffIPP
		$this->DiffIPP->ViewValue = $this->DiffIPP->CurrentValue;
		$this->DiffIPP->ViewValue = ew_FormatNumber($this->DiffIPP->ViewValue, 2, -2, -2, -2);
		$this->DiffIPP->CssStyle = "";
		$this->DiffIPP->CssClass = "";
		$this->DiffIPP->ViewCustomAttributes = "";

		// LogIPP
		$this->LogIPP->ViewValue = $this->LogIPP->CurrentValue;
		$this->LogIPP->ViewValue = ew_FormatNumber($this->LogIPP->ViewValue, 2, -2, -2, -2);
		$this->LogIPP->CssStyle = "";
		$this->LogIPP->CssClass = "";
		$this->LogIPP->ViewCustomAttributes = "";

		// QtyIPP
		$this->QtyIPP->ViewValue = $this->QtyIPP->CurrentValue;
		$this->QtyIPP->ViewValue = ew_FormatNumber($this->QtyIPP->ViewValue, 2, -2, -2, -2);
		$this->QtyIPP->CssStyle = "";
		$this->QtyIPP->CssClass = "";
		$this->QtyIPP->ViewCustomAttributes = "";

		// BankIPP
		$this->BankIPP->ViewValue = $this->BankIPP->CurrentValue;
		$this->BankIPP->ViewValue = ew_FormatCurrency($this->BankIPP->ViewValue, 2, -2, -2, -2);
		$this->BankIPP->CssStyle = "";
		$this->BankIPP->CssClass = "";
		$this->BankIPP->ViewCustomAttributes = "";

		// XReadMOAmtDiff
		$this->XReadMOAmtDiff->ViewValue = $this->XReadMOAmtDiff->CurrentValue;
		$this->XReadMOAmtDiff->ViewValue = ew_FormatNumber($this->XReadMOAmtDiff->ViewValue, 2, -2, -2, -2);
		$this->XReadMOAmtDiff->CssStyle = "";
		$this->XReadMOAmtDiff->CssClass = "";
		$this->XReadMOAmtDiff->ViewCustomAttributes = "";

		// MOAmt
		$this->MOAmt->ViewValue = $this->MOAmt->CurrentValue;
		$this->MOAmt->ViewValue = ew_FormatNumber($this->MOAmt->ViewValue, 2, -2, -2, -2);
		$this->MOAmt->CssStyle = "";
		$this->MOAmt->CssClass = "";
		$this->MOAmt->ViewCustomAttributes = "";

		// BankMO
		$this->BankMO->ViewValue = $this->BankMO->CurrentValue;
		$this->BankMO->ViewValue = ew_FormatNumber($this->BankMO->ViewValue, 2, -2, -2, -2);
		$this->BankMO->CssStyle = "";
		$this->BankMO->CssClass = "";
		$this->BankMO->ViewCustomAttributes = "";

		// CreditAmt
		$this->CreditAmt->ViewValue = $this->CreditAmt->CurrentValue;
		$this->CreditAmt->ViewValue = ew_FormatNumber($this->CreditAmt->ViewValue, 2, -2, -2, -2);
		$this->CreditAmt->CssStyle = "";
		$this->CreditAmt->CssClass = "";
		$this->CreditAmt->ViewCustomAttributes = "";

		// BankCC
		$this->BankCC->ViewValue = $this->BankCC->CurrentValue;
		$this->BankCC->ViewValue = ew_FormatNumber($this->BankCC->ViewValue, 2, -1, -2, -2);
		$this->BankCC->CssStyle = "";
		$this->BankCC->CssClass = "";
		$this->BankCC->ViewCustomAttributes = "";

		// DiffCopay
		$this->DiffCopay->ViewValue = $this->DiffCopay->CurrentValue;
		$this->DiffCopay->ViewValue = ew_FormatNumber($this->DiffCopay->ViewValue, 2, -1, -2, -2);
		$this->DiffCopay->CssStyle = "";
		$this->DiffCopay->CssClass = "";
		$this->DiffCopay->ViewCustomAttributes = "";

		// CashRxDiffAmt
		$this->CashRxDiffAmt->ViewValue = $this->CashRxDiffAmt->CurrentValue;
		$this->CashRxDiffAmt->ViewValue = ew_FormatNumber($this->CashRxDiffAmt->ViewValue, 2, -2, -2, -2);
		$this->CashRxDiffAmt->CssStyle = "";
		$this->CashRxDiffAmt->CssClass = "";
		$this->CashRxDiffAmt->ViewCustomAttributes = "";

		// CheckAmt
		$this->CheckAmt->ViewValue = $this->CheckAmt->CurrentValue;
		$this->CheckAmt->ViewValue = ew_FormatNumber($this->CheckAmt->ViewValue, 2, -2, -2, -2);
		$this->CheckAmt->CssStyle = "";
		$this->CheckAmt->CssClass = "";
		$this->CheckAmt->ViewCustomAttributes = "";

		// LunchAmt
		$this->LunchAmt->ViewValue = $this->LunchAmt->CurrentValue;
		$this->LunchAmt->ViewValue = ew_FormatNumber($this->LunchAmt->ViewValue, 2, -2, -2, -2);
		$this->LunchAmt->CssStyle = "";
		$this->LunchAmt->CssClass = "";
		$this->LunchAmt->ViewCustomAttributes = "";

		// PayoutAmt
		$this->PayoutAmt->ViewValue = $this->PayoutAmt->CurrentValue;
		$this->PayoutAmt->ViewValue = ew_FormatNumber($this->PayoutAmt->ViewValue, 2, -2, -2, -2);
		$this->PayoutAmt->CssStyle = "";
		$this->PayoutAmt->CssClass = "";
		$this->PayoutAmt->ViewCustomAttributes = "";

		// 340B
		$this->z340B->ViewValue = $this->z340B->CurrentValue;
		$this->z340B->ViewValue = ew_FormatNumber($this->z340B->ViewValue, 2, -2, -2, -2);
		$this->z340B->CssStyle = "";
		$this->z340B->CssClass = "";
		$this->z340B->ViewCustomAttributes = "";

		// Kinray
		$this->Kinray->ViewValue = $this->Kinray->CurrentValue;
		$this->Kinray->ViewValue = ew_FormatNumber($this->Kinray->ViewValue, 2, -2, -2, -2);
		$this->Kinray->CssStyle = "";
		$this->Kinray->CssClass = "";
		$this->Kinray->ViewCustomAttributes = "";

		// CashAdj
		$this->CashAdj->ViewValue = $this->CashAdj->CurrentValue;
		$this->CashAdj->ViewValue = ew_FormatNumber($this->CashAdj->ViewValue, 2, -2, -2, -2);
		$this->CashAdj->CssStyle = "";
		$this->CashAdj->CssClass = "";
		$this->CashAdj->ViewCustomAttributes = "";

		// OverAmt
		$this->OverAmt->ViewValue = $this->OverAmt->CurrentValue;
		$this->OverAmt->ViewValue = ew_FormatNumber($this->OverAmt->ViewValue, 2, -2, -2, -2);
		$this->OverAmt->CssStyle = "";
		$this->OverAmt->CssClass = "";
		$this->OverAmt->ViewCustomAttributes = "";

		// ID
		$this->ID->HrefValue = "";

		// LogDate
		$this->LogDate->HrefValue = "";

		// RegID
		$this->RegID->HrefValue = "";

		// UserName
		$this->UserName->HrefValue = "";

		// StoreNet
		$this->StoreNet->HrefValue = "";

		// ShortOver
		$this->ShortOver->HrefValue = "";

		// DiffIPP
		$this->DiffIPP->HrefValue = "";

		// LogIPP
		$this->LogIPP->HrefValue = "";

		// QtyIPP
		$this->QtyIPP->HrefValue = "";

		// BankIPP
		$this->BankIPP->HrefValue = "";

		// XReadMOAmtDiff
		$this->XReadMOAmtDiff->HrefValue = "";

		// MOAmt
		$this->MOAmt->HrefValue = "";

		// BankMO
		$this->BankMO->HrefValue = "";

		// CreditAmt
		$this->CreditAmt->HrefValue = "";

		// BankCC
		$this->BankCC->HrefValue = "";

		// DiffCopay
		$this->DiffCopay->HrefValue = "";

		// CashRxDiffAmt
		$this->CashRxDiffAmt->HrefValue = "";

		// CheckAmt
		$this->CheckAmt->HrefValue = "";

		// LunchAmt
		$this->LunchAmt->HrefValue = "";

		// PayoutAmt
		$this->PayoutAmt->HrefValue = "";

		// 340B
		$this->z340B->HrefValue = "";

		// Kinray
		$this->Kinray->HrefValue = "";

		// CashAdj
		$this->CashAdj->HrefValue = "";

		// OverAmt
		$this->OverAmt->HrefValue = "";
	}
	var $CurrentAction; // Current action
	var $EventName; // Event name
	var $EventCancelled; // Event cancelled
	var $CancelMessage; // Cancel message
	var $RowType; // Row Type
	var $CssClass; // Css class
	var $CssStyle; // Css style
	var $RowClientEvents; // Row client events

	// Display Attribute
	function DisplayAttributes() {
		$sAtt = "";
		if (trim($this->CssStyle) <> "") {
			$sAtt .= " style=\"" . trim($this->CssStyle) . "\"";
		}
		if (trim($this->CssClass) <> "") {
			$sAtt .= " class=\"" . trim($this->CssClass) . "\"";
		}
		if ($this->Export == "") {
			if (trim($this->RowClientEvents) <> "") {
				$sAtt .= " " . $this->RowClientEvents;
			}
		}
		return $sAtt;
	}

	// Export
	var $Export;

//	 ----------------
//	  Field objects
//	 ----------------
	function fields($fldname) {
		return $this->fields[$fldname];
	}

	// Table level events
	// Recordset Selecting event
	function Recordset_Selecting(&$filter) {

		// Enter your code here	
	}

	// Recordset Selected event
	function Recordset_Selected(&$rs) {

		//echo "Recordset Selected";
	}

	// Row_Selecting event
	function Row_Selecting(&$filter) {

		// Enter your code here	
	}

	// Row Selected event
	function Row_Selected(&$rs) {

		//echo "Row Selected";
	}

	// Row Rendering event
	function Row_Rendering() {

		// Enter your code here	
	}

	// Row Rendered event
	function Row_Rendered() {

		// To view properties of field class, use:
		//var_dump($this-><FieldName>); 

	}

	// Row Inserting event
	function Row_Inserting(&$rs) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Inserted event
	function Row_Inserted(&$rs) {

		//echo "Row Inserted";
	}

	// Row Updating event
	function Row_Updating(&$rsold, &$rsnew) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Updated event
	function Row_Updated(&$rsold, &$rsnew) {

		//echo "Row Updated";
	}

	// Row Deleting event
	function Row_Deleting($rs) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Deleted event
	function Row_Deleted(&$rs) {

		//echo "Row Deleted";
	}
}
?>
